<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>氦闪</title>
    <link rel="icon" href="__PUBLIC__/web/images/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="__PUBLIC__/web/css/public.css">
    <link rel="stylesheet" href="__PUBLIC__/web/css/user.css">
</head>
<body>
<header>
    <include file="Index/header"/>
</header>


<div class="ly-master">
    <ul class="ly-nav">
        <li>
            <h1>服装索引</h1>
            <dd>系列</dd>
            <dl>
                <volist name="category" id="vo">

                    <dt><a href="{:U('Index/home', ['cate_id' => $vo['cate_id']])}">{$vo.cate_name}</a></dt>
                </volist>
            </dl>
        </li>
        <li>
            <dd class="ly-cation"><a href="{:U('Index/user')}">我的订单</a></dd>
            <dd ><a href="{:U('Address/address_list')}">收货信息</a></dd>
            <dd ><a href="{:U('Index/user_info')}">账户信息</a></dd>
            <dd><a href="{:U('Index/sale')}">售后信息</a></dd>
        </li>
    </ul>
</div>

<section>
    <!--登录状态点击个人中心的界面-->
    <div class="ly-content ly-cent">
        <div class="ly-title">我的订单</div>
        <ul class="ly-li">
            <li>商品信息</li>
            <li>快递单号</li>
            <li>金额</li>
            <li>购买日期</li>
            <li>操作</li>
        </ul>
        <ul class="ly-list">
            <volist name="list" id="vo">
                <li>
                    <dl>
                        <img src="{$vo.cover_photo}"/>
                        <h1> 商品：{$vo.product_name}</h1>
                        <p> 规格：{$vo.option_name}</p>
                        <p> 数量：{$vo.quantity} </p>
                        <p> 编码：<b style="font-size: 24px!important;">{$vo.number|default='-'}</b></p>
                    </dl>
                    <dl>
                        <h1><strong class="ly-dang">快递单号：</strong>{$vo.logistics_number|default='-'}</h1>
                        <p></br>{$vo.logistics_company}</p>
                    </dl>
                    <dl>
                        <h2>¥ {$vo.order_price}</h2>
                        <p>{$vo.status_string}</p>

                    </dl>
                    <dl>
                        <h5>{$vo.create_time}</h5>
                    </dl>
                    <dl>
                        <if condition="$vo.status eq 'unpay'">
                                <a href="{:U('Cart/pay', ['order_id' => $vo['order_id']])}">立即付款</a>
                                <a href="javascript:;" class="cancel" order_id="{$vo.order_id}">取消订单</a>
                                <a href="javascript:;" class="del" order_id="{$vo.order_id}">删除订单</a>
                            <elseif condition="$vo.status eq 'deliver'"/>
                                <a href="javascript:;" order_id="{$vo.order_id}" class="sure">确认收货</a>
                                <!--<a href="javascript:;" order_id="{$vo.order_id}" class="refund">申请退款</a>-->
                            <elseif condition="$vo.status eq 'payed'" />
                                <a href="javascript:;" order_id="{$vo.order_id}" class="refund">申请退款</a>
                            <else/>


                        </if>

                        <a href="{:U('contact')}">订单有疑问?</a>
                    </dl>
                </li>
            </volist>


        </ul>
        <div class="ly-h1">
            如对以上信息有疑问，请直接<a class="ly-a" href="{:U('contact')}">联系我们</a>
        </div>
    </div>

    <include file="Index/footer"/>
</section>

<div class="ly-menu-nav" data-id="1">
    <img src="__PUBLIC__/web/images/icon_menu.png" />
</div>
</body>
<script src="__PUBLIC__/web/js/jquery.min.js"></script>
<script src="__PUBLIC__/web/js/public.js"></script>
<script>
    $('.sure').click(function () {
        var order_id = $(this).attr('order_id');
        if(confirm('确认收货吗？')) {
            $.ajax({
                url: "{:U('Index/sureGet')}",
                dataType:"json",
                data:{order_id:order_id},
                type:'POST',
                async:true,
                beforeSend:function(){

//                $("body").showLoading();
                },
                success:function(rst){
                    console.log(rst);
                    if(rst.code == '200') {
                        window.location.reload();
                    } else {
                        alert(rst.mark);
                    }
                },
                error: function(){
//                $("body").hideLoading();
//                    alert("错误");
                }

            });
        }
    })

    $('.refund').click(function () {
        var order_id = $(this).attr('order_id');
        if(confirm('确认申请退款吗？')) {
            $.ajax({
                url: "{:U('refund')}",
                dataType:"json",
                data:{order_id:order_id},
                type:'POST',
                async:true,
                beforeSend:function(){

//                $("body").showLoading();
                },
                success:function(rst){
                    console.log(rst);
                    if(rst.code == '200') {
                        window.location.reload();
                    } else {
                        alert(rst.mark);
                    }
                },
                error: function(){
//                $("body").hideLoading();
//                    alert("错误");
                }

            });
        }
    })

    $('.cancel').click(function () {
        var order_id = $(this).attr('order_id');
        if(confirm('确认取消吗？')) {
            $.ajax({
                url: "{:U('Index/cancel')}",
                dataType:"json",
                data:{order_id:order_id},
                type:'POST',
                async:true,
                beforeSend:function(){

//                $("body").showLoading();
                },
                success:function(rst){
                    console.log(rst);
                    if(rst.code == '200') {
                        window.location.reload();
                    } else {
                        alert(rst.mark);
                    }
                },
                error: function(){
//                $("body").hideLoading();
//                    alert("错误");
                }

            });
        }
    })
    $('.del').click(function () {
        var order_id = $(this).attr('order_id');
        if(confirm('确认删除吗？')) {
            $.ajax({
                url: "{:U('Index/del')}",
                dataType:"json",
                data:{order_id:order_id},
                type:'POST',
                async:true,
                beforeSend:function(){

//                $("body").showLoading();
                },
                success:function(rst){
                    console.log(rst);
                    if(rst.code == '200') {
                        window.location.reload();
                    } else {
                        alert(rst.mark);
                    }
                },
                error: function(){
//                $("body").hideLoading();
//                    alert("错误");
                }

            });
        }
    })
</script>
</html>





